package com.realestate.services;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.realestate.constants.ComTxManagerName;
import com.realestate.dao.CategoryDao;
import com.realestate.model.BrtbCategory;

@Service
public class CategoryServiceImpl implements CategoryService{
	
	private static final Logger logger = Logger.getLogger(CategoryServiceImpl.class);
	
	@Autowired
    private CategoryDao categoryDao;
 
    public CategoryDao getCategoryDao() {
        return categoryDao;
    }
    
    public void setCategoryDao(CategoryDao categoryDao) {
        this.categoryDao = categoryDao;
    }
 
    @Transactional(value = ComTxManagerName.COM_TRANSACTION_MANAGER)
    public void insert(BrtbCategory category) {
        getCategoryDao().insert(category);
    }
 
    @Transactional(value = ComTxManagerName.COM_TRANSACTION_MANAGER)
    public List<BrtbCategory> selectAll() {
        return getCategoryDao().selectAll();
    }
}
